package com.mall.shopping.dal.entitys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@TableName("tb_panel")
@Table(name = "tb_panel")
public class Panel implements Serializable {
    @TableId(type = IdType.AUTO)
    @Id
    @KeySql(useGeneratedKeys = true)
    private Integer id;

    private String name;

    private Integer type;

    private Integer sortOrder;

    private Integer position;

    private Integer limitNum;

    private Integer status;

    private String remark;

    private Date created;

    private Date updated;

    @TableField(exist = false)// 一对多
    @OneToMany
    @JoinColumn(name="id",referencedColumnName = "panel_id")//@TableId与一方相关属性中@TableField名称保持一致时@JoinColumn可省略
    private List<PanelContentItem> panelContentItems;


    @Transient
    private Long productId;

    private static final long serialVersionUID = 1L;

}